package com.sunlands.zlcx.usercenter.client;

import com.sunlands.zlcx.usercenter.client.bean.TimeLearnRoomVO;
import com.sunlands.zlcx.usercenter.config.OauthFeignConfig;
import com.sunlands.zlcx.usercenter.vo.LiveExperienceVO;
import com.sunlands.zlcx.usercenter.vo.TimeLearnRoomSeatsVO;
import com.sunlands.zlcx.usercenter.vo.feign.RoomPublisherVO;
import com.sunlands.zlcx.usercenter.vo.response.BusinessResult;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "tz-live-video", configuration = OauthFeignConfig.class)
public interface LiveVideoService {

    /**
     * 查询连麦记录
     * @param publishRecordId publishRecordId
     * @return JSONObject
     */
    @RequestMapping(value = "/publisher/recordInfo/{publishRecordId}")
    BusinessResult<RoomPublisherVO> getPublishRecordId(@PathVariable(value = "publishRecordId") Long publishRecordId);

    @GetMapping(value = "/liveRoom/adminKickingUser/{userId}")
    BusinessResult adminKickingUser(
            @ApiParam(value = "用户id", required = true) @PathVariable(value = "userId") Long userId,
            @ApiParam(value = "密钥", required = true) @RequestParam(value = "sign") String sign);

    @GetMapping(value = "/test")
    BusinessResult test();

    @GetMapping("/liveRoom/getPublisherInfo/{userId}")
    BusinessResult<RoomPublisherVO> getPublisherInfoByUserId(@ApiParam(value = "用户id", required = true) @PathVariable(value = "userId") Long userId);

    @GetMapping(value = "/liveRoom/free/{userId}")
    BusinessResult<LiveExperienceVO> applyPublish(@ApiParam(value = "用户id", required = true) @PathVariable(value = "userId") Long userId);

    @PutMapping(value = "/liveRoom/avatar")
    BusinessResult<LiveExperienceVO> changeRoomAvatar(@ApiParam(value = "用户id", required = true) @RequestParam(value = "userId") Long userId,
                                                      @ApiParam(value = "用户id", required = true) @RequestParam(value = "roomId") Long roomId,
                                                      @ApiParam(value = "用户id", required = true) @RequestParam(value = "avatar") String avatar);

    @GetMapping(value = "/timeLearnRoom/detail-user")
    BusinessResult<TimeLearnRoomSeatsVO> detailUser(@ApiParam(value = "用户id", required = true) @RequestParam(value = "userId") Long userId);

    @GetMapping(value = "/timeLearnRoom/simple/roomInfo")
    BusinessResult<TimeLearnRoomVO> getSimpleRoomInfo(@ApiParam(value = "房间id", required = true) @RequestParam(value = "roomId") Long roomId);

    @GetMapping(value = "/acount/checkUserStatus")
    BusinessResult checkUserStatus(@RequestParam("userId") Long userId);
}
